<template>
  <div class="error-page">
    <div class="error-content">
      <div class="error-icon">500</div>
      <h1>服务器错误</h1>
      <p>抱歉，服务器遇到了问题，请稍后再试</p>
      <div class="error-actions">
        <el-button type="primary" @click="refresh">刷新页面</el-button>
        <el-button @click="goHome">返回首页</el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const refresh = () => {
  window.location.reload()
}

const goHome = () => {
  router.push('/')
}
</script>

<style scoped lang="scss">
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f5f7fa;

  .error-content {
    text-align: center;
    padding: 40px;

    .error-icon {
      font-size: 120px;
      font-weight: bold;
      color: #f56c6c;
      margin-bottom: 20px;
    }

    h1 {
      font-size: 32px;
      color: #303133;
      margin-bottom: 16px;
    }

    p {
      font-size: 16px;
      color: #606266;
      margin-bottom: 30px;
    }

    .error-actions {
      display: flex;
      justify-content: center;
      gap: 16px;
    }
  }
}
</style>